package org.yufan.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.yufan.bean.Employee;
import org.yufan.datasource.DataSource;
import org.yufan.repository.EmployeeRepository;
import org.yufan.service.EmployeeService;

@Service
@Transactional
@DataSource("ds1")
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    private EmployeeRepository employeeRepository;

    @Override
    public void update(Integer age, Integer id) {
        employeeRepository.update(age,id);
    }

    @Override
    public void addEmployee(Employee employee) {
        employeeRepository.save(employee);
    }
}
